<div id="History-browsing"></div>
<table class="header" cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">|[[cvs: Adding, removing, and renaming files and directories#Adding, removing, and renaming files and directories| &lt;&lt; ]]|</td>
<td valign="middle" align="left">|[[cvs: Adding, removing, and renaming files and directories#Moving and renaming directories| &lt; ]]|</td>
<td valign="middle" align="left">|[[cvs#Top| Up ]]|</td>
<td valign="middle" align="left">|[[#Log messages| &gt; ]]|</td>
<td valign="middle" align="left">|[[cvs: Handling binary files#Handling binary files| &gt;&gt; ]]|</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">|[[cvs#Top|Top]]|</td>
<td valign="middle" align="left">|[[cvs: Table of Contents#SEC_Contents|Contents]]|</td>
<td valign="middle" align="left">|[[cvs: Index#Index|Index]]|</td>
<td valign="middle" align="left">|[[cvs: About this Manual#SEC_About| ? ]]|</td>
</tr></table>
<div id="History-browsing-1"></div>
== History browsing ==
<div id="index-History-browsing"></div>
<div id="index-Traceability"></div>
<div id="index-Isolation"></div>


Once you have used <small>CVS</small> to store a version control
history&mdash;what files have changed when, how, and by
whom, there are a variety of mechanisms for looking
through the history.

<div class="menu-preformatted" style="font-family: serif">
 [[#Log messages|&bull; log messages]]::                Log messages
 [[#The history database|&bull; history database]]::            The history database
 [[#User-defined logging|&bull; user-defined logging]]::        User-defined logging
 [[#Annotate command|&bull; annotate]]::                    What revision modified each line of a file?
</div>


----

<div id="log-messages"></div>
<table class="header" cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">|[[#History browsing| &lt;&lt; ]]|</td>
<td valign="middle" align="left">|[[#History browsing| &lt; ]]|</td>
<td valign="middle" align="left">|[[#History browsing| Up ]]|</td>
<td valign="middle" align="left">|[[#The history database| &gt; ]]|</td>
<td valign="middle" align="left">|[[cvs: Handling binary files#Handling binary files| &gt;&gt; ]]|</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">|[[cvs#Top|Top]]|</td>
<td valign="middle" align="left">|[[cvs: Table of Contents#SEC_Contents|Contents]]|</td>
<td valign="middle" align="left">|[[cvs: Index#Index|Index]]|</td>
<td valign="middle" align="left">|[[cvs: About this Manual#SEC_About| ? ]]|</td>
</tr></table>
<div id="Log-messages"></div>
=== Log messages ===

Whenever you commit a file you specify a log message.

To look through the log messages which have been
specified for every revision which has been committed,
use the <code>cvs log</code> command (see section [[cvs: Guide to CVS commands#log&mdash;Print out log information for files|log&mdash;Print out log information for files]]).


----

<div id="history-database"></div>
<table class="header" cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">|[[#History browsing| &lt;&lt; ]]|</td>
<td valign="middle" align="left">|[[#Log messages| &lt; ]]|</td>
<td valign="middle" align="left">|[[#History browsing| Up ]]|</td>
<td valign="middle" align="left">|[[#User-defined logging| &gt; ]]|</td>
<td valign="middle" align="left">|[[cvs: Handling binary files#Handling binary files| &gt;&gt; ]]|</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">|[[cvs#Top|Top]]|</td>
<td valign="middle" align="left">|[[cvs: Table of Contents#SEC_Contents|Contents]]|</td>
<td valign="middle" align="left">|[[cvs: Index#Index|Index]]|</td>
<td valign="middle" align="left">|[[cvs: About this Manual#SEC_About| ? ]]|</td>
</tr></table>
<div id="The-history-database"></div>
=== The history database ===

You can use the history file (see section [[cvs: Reference manual for Administrative files#The history file|The history file]]) to
log various <small>CVS</small> actions.  To retrieve the
information from the history file, use the <code>cvs
history</code> command (see section [[cvs: Guide to CVS commands#history&mdash;Show status of files and users|history&mdash;Show status of files and users]]).

Note: you can control what is logged to this file by using the
&lsquo;<code>LogHistory</code>&rsquo; keyword in the &lsquo;<tt>CVSROOT/config</tt>&rsquo; file
(see section [[cvs: Reference manual for Administrative files#The CVSROOT/config configuration file|The CVSROOT/config configuration file]]).



----

<div id="user_002ddefined-logging"></div>
<table class="header" cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">|[[#History browsing| &lt;&lt; ]]|</td>
<td valign="middle" align="left">|[[#The history database| &lt; ]]|</td>
<td valign="middle" align="left">|[[#History browsing| Up ]]|</td>
<td valign="middle" align="left">|[[#Annotate command| &gt; ]]|</td>
<td valign="middle" align="left">|[[cvs: Handling binary files#Handling binary files| &gt;&gt; ]]|</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">|[[cvs#Top|Top]]|</td>
<td valign="middle" align="left">|[[cvs: Table of Contents#SEC_Contents|Contents]]|</td>
<td valign="middle" align="left">|[[cvs: Index#Index|Index]]|</td>
<td valign="middle" align="left">|[[cvs: About this Manual#SEC_About| ? ]]|</td>
</tr></table>
<div id="User_002ddefined-logging"></div>
=== User-defined logging ===

You can customize <small>CVS</small> to log various kinds of
actions, in whatever manner you choose.  These
mechanisms operate by executing a script at various
times.  The script might append a message to a file
listing the information and the programmer who created
it, or send mail to a group of developers, or, perhaps,
post a message to a particular newsgroup.  To log
commits, use the &lsquo;<tt>loginfo</tt>&rsquo; file (see section [[cvs: Reference manual for Administrative files#Loginfo|Loginfo]]).
To log commits, checkouts, exports, and tags,
respectively, you can also use the &lsquo;<code>-i</code>&rsquo;,
&lsquo;<code>-o</code>&rsquo;, &lsquo;<code>-e</code>&rsquo;, and &lsquo;<code>-t</code>&rsquo; options in the
modules file.  For a more flexible way of giving
notifications to various users, which requires less in
the way of keeping centralized scripts up to date, use
the <code>cvs watch add</code> command (see section [[cvs: Multiple developers#Telling CVS to notify you|Telling CVS to notify you]]); this command is useful even if you are not
using <code>cvs watch on</code>.

<div id="index-taginfo"></div>
<div id="index-Exit-status_002c-of-taginfo"></div>
The &lsquo;<tt>taginfo</tt>&rsquo; file defines programs to execute
when someone executes a <code>tag</code> or <code>rtag</code>
command.  The &lsquo;<tt>taginfo</tt>&rsquo; file has the standard form
for administrative files (see section [[cvs: Reference manual for Administrative files#Reference manual for Administrative files|Reference manual for Administrative files]]), where each line is a regular expression
followed by a command to execute.  The arguments passed
to the command are, in order, the <var>tagname</var>,
<var>operation</var> (<code>add</code> for <code>tag</code>,
<code>mov</code> for <code>tag -F</code>, and <code>del</code> for
<code>tag -d</code>), <var>repository</var>, and any remaining are
pairs of <var>filename</var> <var>revision</var>.  A non-zero
exit of the filter program will cause the tag to be
aborted.

Here is an example of using taginfo to log tag and rtag
commands.  In the taginfo file put:

<div class="example" style="margin-left: 3.2em">
 ALL /usr/local/cvsroot/CVSROOT/loggit
</div>

Where &lsquo;<tt>/usr/local/cvsroot/CVSROOT/loggit</tt>&rsquo; contains the
following script:

<div class="example" style="margin-left: 3.2em">
 #!/bin/sh
 echo &quot;$@&quot; &gt;&gt;/home/kingdon/cvsroot/CVSROOT/taglog
</div>


----

<div id="annotate"></div>
<table class="header" cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">|[[#History browsing| &lt;&lt; ]]|</td>
<td valign="middle" align="left">|[[#User-defined logging| &lt; ]]|</td>
<td valign="middle" align="left">|[[#History browsing| Up ]]|</td>
<td valign="middle" align="left">|[[cvs: Handling binary files#Handling binary files| &gt; ]]|</td>
<td valign="middle" align="left">|[[cvs: Handling binary files#Handling binary files| &gt;&gt; ]]|</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">|[[cvs#Top|Top]]|</td>
<td valign="middle" align="left">|[[cvs: Table of Contents#SEC_Contents|Contents]]|</td>
<td valign="middle" align="left">|[[cvs: Index#Index|Index]]|</td>
<td valign="middle" align="left">|[[cvs: About this Manual#SEC_About| ? ]]|</td>
</tr></table>
<div id="Annotate-command"></div>
=== Annotate command ===
<div id="index-annotate-_0028subcommand_0029"></div>

;<div id="index-cvs-annotate"></div>Command<nowiki>:</nowiki> <strong>cvs annotate</strong><em> <nowiki>[</nowiki><code>-FflR</code><nowiki>]</nowiki> <nowiki>[</nowiki><code>-r rev</code>|<code>-D date</code><nowiki>]</nowiki> files &hellip;</em>

: For each file in <var>files</var>, print the head revision of the trunk, together with information on the last modification for each line.  For example:

<div class="example" style="margin-left: 3.2em">
 $ cvs annotate ssfile
 Annotations for ssfile
 ***************
 1.1          (mary     27-Mar-96): ssfile line 1
 1.2          (joe      28-Mar-96): ssfile line 2
</div>

: The file &lsquo;<tt>ssfile</tt>&rsquo; currently contains two lines. The <code>ssfile line 1</code> line was checked in by <code>mary</code> on March 27.  Then, on March 28, <code>joe</code> added a line <code>ssfile line 2</code>, without modifying the <code>ssfile line 1</code> line.  This report doesn&rsquo;t tell you anything about lines which have been deleted or replaced; you need to use <code>cvs diff</code> for that (see section [[cvs: Guide to CVS commands#diff&mdash;Show differences between revisions|diff&mdash;Show differences between revisions]]).


The options to <code>cvs annotate</code> are listed in
[[cvs: Quick reference to CVS commands#Quick reference to CVS commands|Quick reference to CVS commands]], and can be used to select the files
and revisions to annotate.  The options are described
in more detail there and in [[cvs: Guide to CVS commands#Common command options|Common command options]].



----

<table class="header" cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">|[[#History browsing| &lt;&lt; ]]|</td>
<td valign="middle" align="left">|[[cvs: Handling binary files#Handling binary files| &gt;&gt; ]]|</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">|[[cvs#Top|Top]]|</td>
<td valign="middle" align="left">|[[cvs: Table of Contents#SEC_Contents|Contents]]|</td>
<td valign="middle" align="left">|[[cvs: Index#Index|Index]]|</td>
<td valign="middle" align="left">|[[cvs: About this Manual#SEC_About| ? ]]|</td>
</tr></table>
This document was generated on <i>a sunny day</i> using [http://www.nongnu.org/texi2html/ <i>texi2html</i>].
